Kubernetes Deep Dive — Practices and Further Notes

Last Edited
Tags
study

Start K8S

Create a cluster

# master node (need a new instance)
kubeadm init --apiserver-advertise-address ...
# use printout second command
kubectl apply -f https://raw.githubusercon ...
# verify master node ready
kubectl get nodes

# worker node (need a new instance)
# copy and paste the output from the last kubeadm init command
kubeadm join ...

Pod, Deployment, Service

Deployment:

Service:

Figure: NodePortService Redirection

Practices:

# ============ useful commands ===========
# get pods on one node
kubectl get pods --all-namespaces -o wide --field-selector spec.nodeName=<node>
# see pods status: spec is the desired status, status is observed status
kubectl get pods <pod-name> -o yaml
# get rolling update status
kubectl rollout status deployment <deployment-name>
# get list of endpoint object
kubectl get ep hello-svc

Figure: I set 10 deploy object, which loads balance to two worker nodes, while the master node has most of the Kubernetes system running: etcd, API server, etc.

Figure: rolling update status

Figure: a list of health pods. this list will be updated as pods are down or up

Service Discovery

Kubernetes Storage

ConfigMap, StatefulSet, DaemonSet

ConfigMap

StatefulSet

DaemonSet

Reference

Notes mostly are summarized from or refer to Learn Kubernetes: A Deep Dive https://www.educative.io/courses/the-kubernetes-course